const state = {
  wechatSignUrl: ""
}
const u = navigator.userAgent,
  isIos = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
const mutations = {
  setWechatSignUrl(state, wxSignUrl) {
    // 关键点
    // IOS仅记录第一次进入页面时的URL
    // IOS微信切换路由实际URL不变，只能使用第一进入页面的URL进行签名
    if (isIos && state.wechatSignUrl !== '') {
      return;
    }
    state.wechatSignUrl = wxSignUrl;
  }
}

const actions = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
